#pragma once
#include <windows.h>
#include <windowsx.h>

LRESULT CALLBACK WindowProcedure(HWND, UINT, WPARAM, LPARAM); 

class MyWindow
{
public: 
	HWND hwnd;
	int  WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, LPSTR lpszArgs, int nWinMode) 
	{
		char szWinName[] = "MyWindow";      
		char szTitle[] = "Trapeze";               
		MSG msg;                    
		WNDCLASS wc;                                 
		ZeroMemory(&wc,sizeof(wc));                             
		wc.hInstance = hInstance;                                     
		wc.lpszClassName = szWinName;                          
		wc.lpfnWndProc = WindowProcedure;                           
		wc.style = 0;                                                          
		wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);           
		wc.hCursor = LoadCursor(NULL, IDC_ARROW);              
		wc.hbrBackground = GetStockBrush(WHITE_BRUSH);         
		wc.lpszMenuName = NULL;                                  
		wc.cbClsExtra = 0;                                                 
		wc.cbWndExtra = 0;                                                

		if(!RegisterClass (&wc))                                         
		{                                    
			MessageBox (NULL, "The Window has not been registered.", "Error", MB_OK);
			return 1;
		}                                                           
		hwnd = CreateWindow (szWinName,                                             
			szTitle,                                                       
			WS_BORDER,               
			700,                                                            
			0,                                                            
			600,                                                            
			800,                                                            
			HWND_DESKTOP,                                 
			NULL,                                                       
			hInstance,                                                  
			NULL);                                                     
		ShowWindow (hwnd, SW_SHOWNOACTIVATE);       

		while(GetMessage(&msg, NULL, 0, 0))               
			DispatchMessage(&msg);                              
		return 0;                                                     
	}                                                                    
};
